package tx.bj12320.dao;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import tx.bj12320.model.*;
import tx.bj12320.dao.*;
import tx.bj12320.service.*;
import tx.bj12320.vo.query.*;


import static cn.org.rapid_framework.util.ObjectUtils.*;
import org.springframework.stereotype.Repository;

@Repository
public class MeetingDao extends BaseHibernateDao<Meeting,Long>{

	public Class getEntityClass() {
		return Meeting.class;
	}

	public Page findPage(MeetingQuery query) {
        // [column]为字符串拼接, {column}为使用占位符. [column]为使用字符串拼接,如username='[username]',偷懒时可以使用字符串拼接
        // [column] 为PageRequest的属性
		String sql = "select t from Meeting t where 1=1 "
				+ "/~ and t.meetingStartTime >= {meetingStartTimeBegin} ~/"
				+ "/~ and t.meetingStartTime <= {meetingStartTimeEnd} ~/"
				+ "/~ and t.meetingEndTime >= {meetingEndTimeBegin} ~/"
				+ "/~ and t.meetingEndTime <= {meetingEndTimeEnd} ~/"
			  	+ "/~ and t.meetingPersonNum = {meetingPersonNum} ~/"
			  	+ "/~ and t.meetingPersons = {meetingPersons} ~/"
			  	+ "/~ and t.meetingAddress = {meetingAddress} ~/"
			  	+ "/~ and t.meetingRequrment = {meetingRequrment} ~/"
			  	+ "/~ and t.dealPerson = {dealPerson} ~/"
			  	+ "/~ and t.contactPerson = {contactPerson} ~/"
			  	+ "/~ and t.meetingTitle = {meetingTitle} ~/"
			  	+ "/~ and t.meetingContent = {meetingContent} ~/"
			  	+ "/~ and t.meetingRemark = {meetingRemark} ~/"
				+ "/~ order by [sortColumns] ~/";


		return pageQuery(sql,query);
	}


}
